" require:
" 1.nodejs
" 2.npm

" autoload plug.vim
if empty(glob('~/.config/nvim/autoload/plug.vim'))
  :exe '!curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
        \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  au VimEnter * PlugInstall --sync | source $MYVIMRC
endif

" =====================
" = plugins begin =
" =====================
call plug#begin('~/.vim/plugged')
" assembly support
Plug 'refi64/howl-nasm'
" enhance editor(easier comment)
Plug 'tomtom/tcomment_vim'
" clang-format
Plug 'rhysd/vim-clang-format'
" doxygen generate
Plug 'vim-scripts/DoxygenToolkit.vim'
" terminal
Plug 'skywind3000/vim-terminal-help'
" theme
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" highlight
Plug 'jackguo380/vim-lsp-cxx-highlight'
" file explorer
Plug 'scrooloose/nerdtree'
" file finder
Plug 'Yggdroot/LeaderF', { 'do': ':LeaderfInstallCExtension' }
" lsp
Plug 'neoclide/coc.nvim',{'branch':'release'}
" debug
Plug 'puremourning/vimspector', {'do': './install_gadget.py --enable-rust '}
call plug#end()

" =====================
" == load in configs ==
" =====================
function! Dot(path)
  return "~/.config/nvim/" . a:path
endfunction

for file in split(glob(Dot('config/*.vim')),'\n')
  exe 'source' file
endfor


for file in split(glob(Dot('config/plugins/*.vim')),'\n')
  exe 'source' file
endfor





